package com.kamistoat.meimeistore.modulessystem.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kamistoat.meimeistore.apisystem.domain.SysConfig;
import com.kamistoat.meimeistore.commoncore.utils.page.PageUtils;
import com.kamistoat.meimeistore.apisystem.entity.SysConfigEntity;

import java.util.List;
import java.util.Map;

/**
 * 参数配置表
 *
 * @author kamistoat
 * @email linjianshanke@163.com
 * @date 2022-08-09 10:34:46
 */
public interface SysConfigService extends IService<SysConfigEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<SysConfigEntity> selectConfigList(SysConfig sysConfig);

    /**
     * 查k-v并缓存
     */
    String selectConfigByKey(String configKey);

    /**
     * 检查 SysConfig是否已经存在
     */
    boolean checkConfigKeyUnique(SysConfig sysConfig);

    boolean saveAndCache(SysConfigEntity sysConfigEntity);

    boolean updateByIdAndCache(SysConfigEntity sysConfigEntity);

    boolean deleteConfigByIdsAndRemoveCache(Long[] configIds);

    /**
     * 重新加载参数缓存
     */
    void resetConfigCache();
}

